Repository navigation
Fix lazy resolution of class and function object completions - #742
Open
Mohamed-El-Mouhib wants to merge 1 commit into
Open
Mohamed-El-Mouhib wants to merge 1 commit into
Mohamed-El-Mouhib wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
jedi_completion.include_class_objectsorinclude_function_objectsis enabled, the additional object completion items are returned to the client but cannot be resolved lazily. For example, with both settings enabled,FooclassandFoofunc()resolve normally, whileFooclass objectandFoofunc() objectremain without documentation or detail aftercompletionItem/resolve.The cache construction zips the expanded list of LSP completion items with the original, shorter Jedi completion list. The appended items are consequently omitted from
LAST_JEDI_COMPLETIONS.Change
Keep a parallel list of source Jedi completions and append the corresponding source for each additional object item. Build the existing resolution cache from the paired lists. This preserves the completion ordering, insertion text, kind, and document URI metadata without changing eager resolution or the existing cache format.
Adds regression tests for class-only, function-only, and combined object completion settings, checking both ordinary and appended items, order, cache membership, document metadata, and the documentation of each resolved item.
Validation
a362006(missing appended cache entries) and pass on this branch.[all,test]dependencies:CI=true OS=macos PYTHON_VERSION=3.14 python -m pytest --color=yes -v test/— 204 passed, 10 skipped, 0 failures, 90% overall coverage. The skips are existing platform/CI-specific conditions.ruff check pylsp testandruff format --check pylsp testpassed.git diff --checkpassed.Linux and Windows CI matrix jobs have not been independently run locally.
AI disclosure: ChatGPT assisted with defect investigation, implementation, regression tests, independent code review, and validation.